package filereaders;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * 
 * @author Paul Dannenberg
 * I HAVE REMOVED THIS CLASS FROM CURRENT DESIGN.
 */

public class ParseManager extends Parser {
   
    private List<Parser> myParsers;

    /**
     * Creates a ParseManger that can try to parse a particular
     * datafile. The parsers that this ParseManager will use 
     * will come through as a List of parsers.
     * @param filename The file this ParseManager will attempt to 
     * parse.
     * @param toTry The ParseManager will try to parse filename
     * using the Parsers contained in this list.
     */
    public ParseManager(String filename, List<Parser> toTry) {
        super(filename);
        myParsers = toTry;
    }
    
    protected ParseManager(String filename) {
        super(filename);
        myParsers = new ArrayList<Parser>();
    }
    
    /**
     * After calling this method, a call to a parsing 
     * method will cause ParseManager to try and use p to parse
     * the file.
     * @param p 
     */
    public void addParser(Parser p) {
        myParsers.add(p);
    }

    @Override
    public List<Double> parseDataField(String fieldName) {
        return null;
    }

    @Override
    public Map<Double, Double> parseRelatedDataFields(String keyField,
            String valueField) {
        return getParseHandler().parseRelatedDataFields(keyField, valueField,
                myParsers);
    }

    @Override
    public Map<Date, Double> parseDateToData(String valueField) {
        return getParseHandler()
                .parseDateToDataFields(valueField, myParsers);
    }

    @Override
    public Collection<String> getOptions () {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Map<String, List<String>> parseAll () {
        // TODO Auto-generated method stub
        return null;
    }
}
